extends "../calxJS_Hide/calxJS_Hide.gd"
func _init():
	pass
func _extInit():
	._extInit()
	chaName = "安彼得"                   # 角色的名称
	attCoe.atkRan = 2                 # 攻击距离
	attCoe.maxHp = 5                 # 最大生命（每点代表112.5基础数值，取整数，下同）
	attCoe.atk = 8                   # 攻击力（每点代表8.5）
	attCoe.mgiAtk = 1                 # 魔法攻击（每点代表13.7）
	attCoe.def = 3                    # 物理防御（每点代表15）
	attCoe.mgiDef = 3               # 魔法防御（每点代表16.6）
	atkEff = "atk_dao" 
	xb = "神秘"
	lv = 4
	addSkillTxt("[血腥收割]本回合每阵亡1个非召唤亚比，爆伤提升10%，幻痛收割威力提升10%，最高300%")
	addSkillTxt("[幻影之刃]迅速挥动镰刀攻击目标亚比，造成120%神秘系物理伤害，20%概率提升暴击10%最高60%[CD:6]")
	addSkillTxt("[狂怒镰击]使用镰刀攻击目标两次，每次造成60%神秘系物理伤害，20%概率提升物攻10%最高60%[CD:8]")
	addSkillTxt("[铁血之镰]感知血性，提升自身5%伤害抗性，持续5秒，回合内每阵亡一个亚比，提升抗性5%，最高50%[CD:10]")
	addSkillTxt("[color=#FFFF00][幻痛收割][/color]:[color=#FFCC22]幻化出死神之影攻击敌方全体，造成100%神秘系物理伤害[CD:16][/color]")
	addCdSkill("hyzr",6)
	addCdSkill("knzl",8)
	addCdSkill("txzl",10)
	addCdSkill("htsg",16)

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "hyzr":
		var b = hasBuff("baoji1")
		typeHurtCha(aiCha,att.atk*1.2,Chara.HurtType.PHY,Chara.AtkType.SKILL)
		if sys.rndPer(20):
			if b == null:
				addBuff(bf.baoji1.new())
			elif b.att.cri < 0.6:
				b.att.cri += 0.1
	if id == "knzl":
		var b = hasBuff("wugong1")
		for i in range(2):
			typeHurtCha(aiCha,att.atk*0.6,Chara.HurtType.PHY,Chara.AtkType.SKILL)
			if sys.rndPer(20):
				if b == null:
					addBuff(bf.wugong1.new())
				elif b.att.atkL < 0.6:
					b.att.atkL += 0.1
	if id == "txzl":
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("铁血之镰", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		addBuff(jianshang2.new(5))
		var b = hasBuff("jianshang2")
		if ht != 0 && b.att.defR < 0.5:
			b.att.defR += 0.05
	if id == "htsg":
		var chas = getAllChas(1)
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("幻痛收割", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		for i in chas:
			typeHurtCha(i,att.atk*(1+ht),Chara.HurtType.PHY,Chara.AtkType.SKILL)


class jianshang2:
	extends Buff
	func _init(lv = 1):
		attInit()
		life = lv
		isNegetive=false
		var dispelable = false
		id = "jianshang2"
		att.defR += 0.05

var ht = 0
func _onCharaDel(cha):
	._onCharaDel(cha)
	var b1 = hasBuff("jianshang2")
	var b = hasBuff("baoshang1")
	if !cha.isSumm && isDeath == false:
		if b == null:
			addBuff(bf.baoshang1.new())
		elif b.att.criR < 3:
			b.att.criR += 0.1
	ht += 0.1

func _onBattleStart():
	._onBattleStart()
	ht = 0



